The present disclosure relates to an image processing apparatus, an image processing method, and a program. In particular, the present disclosure relates to an image processing apparatus, an image processing method, and a program for generating and correcting distance images (parallax images).
Recently, cameras capable of imaging stereoscopic images (also referred to as stereo images) have become widespread. For example, using stereo cameras in which lenses are lined up on the left and right, there are cameras imaging a binocular parallax image configured by a pair of a left eye image observed with the left eye and a right eye image observed with the right eye.
By respectively separating the above left eye image and right eye image and performing display thereof on a display apparatus (3D display apparatus) capable of performing presentation to the left eye and the right eye of an observer, the observer is able to view the image as a stereoscopic image, that is, a three-dimensional (3D) image.
The above left eye image and right eye image are capable of being used in a variety of applications as well as being viewed as a stereoscopic image. For example, it is possible to realize processes such as determining the distance from a camera with respect to an imaged subject as a stereoscopic image, cutting out an object on the image corresponding to the distance, and performing synthesis with another image, or reproducing a stereoscopic object in three-dimensional space.
The accurate computation of the distance from the camera to the imaging subject is one important factor in the application of the above kind of stereoscopic images. As a method of representing the information of the distance to the subject, for example, there is a distance image representing the value of the distance by shading the image. The subject distance corresponds to the parallax equivalent to the deviation in the pixel positions of the left eye image and the right eye image, and the distance image is also sometimes referred to as a parallax image.
Using the above distance image (parallax image), a process of cutting out an object on the image corresponding to a distance is performed. In this process, the precision of the distance image is an important point for improving quality.
There is disclosed related art relating to quality improvement of the distance image. For example, Japanese Unexamined Patent Application Publication No. 11-120359 proposes a method including: determining a distance image, setting distance values which are adjacent and which are close in the distance value to the same distance value, labeling the same distance values together, determining the area of each label, setting parallax to which a label of which the area is a fixed value or less is attached as noise, applying a median filter for noise removal with respect to pixels having a distance value set as noise, removing noise of the original image determined as the distance image, and improving the precision of the distance image determined from an original image.
However, although the above method has a local noise removal effect, there is a problem in that it is difficult to remove image errors of a wide range such as deviation of the image generated across a wide range. In addition, in the above-described Japanese Unexamined Patent Application Publication No. 11-120359, in order to determine the noise regions present in the image, the configuration includes performing a labeling process of divided region units of the image, determining the distance at each labelled region unit, computing the area of the distance units, and the like, whereby the processing costs are expected to increase.